home *** CD-ROM | disk | FTP | other *** search
- Article 332 (10 more) in comp.sources.bugs:
- From: jwilke@cosmo.UUCP (Joerg Wilke)
-
- Subject: New Bug in LHARC using MSDOS
- Keywords: Divide by zero for files with lenth 0
- Message-ID: <5238@balu.UUCP>
- Date: 24 Mar 90 23:01:22 GMT
- Sender: news@balu.UUCP
- Reply-To: jwilke@cosmo.UUCP (Joerg Wilke)
- Organization: CosmoNet, D-3000 Hannover 1, FRG
- Lines: 57
-
- I have compiled LHARC using MSDOS 3.3 and MS-C 5.1 and am quite
- happy with it. It's convenient and portable. Thanks to all involved to it.
-
- But:
- If LHARC was extracting files with length zero, it fails with an 'R6003:
- Integer divide by zero' error. I didn't test it with Unix/Xenix, but assume
- it will fail also.
-
- The following patch (Thanks CodeView) in lzhuf.c will fix this bug.
- (Sorry, can't do context diffs)
-
- 885c885,890
- < i = ((size + (indicator_threshold - 1)) / indicator_threshold);
- ---
- > /* Avoid dividing by zero for zero length files */
- > if (size==0) {
- > i = 1; /* draw at least one dot */
- > } else {
- > i = ((size + (indicator_threshold - 1)) / indicator_threshold);
- > };
-
- Maybe other MSDOS-Users are interested in a working but undocumented
- makefile for MSDOS and MS-C 5.1:
-
-
- # Makefile for MS-DOS and MS-C 5.1
- # Don't forget to copy dir.h into your sys/ directory
- .c.obj:
- cl -c -zi $*.c
-
- lharc.obj:
-
- dir_dos.obj:
-
- lhio.obj:
- lzhuf.obj:
- cl -c -ox -zi $*.c
-
- mktemp.obj:
-
- pipes.obj:
-
- lharc.exe: lharc.obj dir_dos.obj lhio.obj lzhuf.obj mktemp.obj pipes.obj
- link /NOE /NOI /CO /st:0x2000 lharc \usr\lib\setargv dir_dos lhio\
- lzhuf mktemp pipes,lharc;
-
-
- _____
- / / . . ) / . / /
- / ___ __ ___ / / / / / ___
- / / ) / / ) / / / / / /( /___)
- / (___/ / (___/ (__/(__/ ( ( ( \ (___
- / /
- (__/ (__/
-
- E-Mail: jwilke@cosmo.uucp or ...!unido!cosmo!jwilke
-